package com.yanqu.road.web.redis.subpub.impl;

import com.yanqu.road.reids.subpub.ReliableMessageSubPub;
import com.yanqu.road.reids.subpub.eRedisChannelType;
import com.yanqu.road.utils.string.StringUtils;
import com.yanqu.road.webservice.invoke.GameWebServiceInvoke;

import java.util.List;

public class ZfbIndexSettingSubPub implements ReliableMessageSubPub {

    String channel = eRedisChannelType.ZfbIndex.getChannel();

    @Override
    public void onMessage(String message) {
        List<String> body = StringUtils.stringToStringList(message, ";");
        GameWebServiceInvoke.triggerPlatformUserBehavior(eRedisChannelType.ZfbIndex.getType(), body.get(0), "");
    }

    @Override
    public boolean isSupport(String channel) {
        return this.channel.equals(channel);
    }

    @Override
    public String getChannel() {
        return this.channel;
    }

    @Override
    public String getKey(String message) {
        return eRedisChannelType.ZfbIndex.getMessageKey(message);
    }
}
